package com.kexinde.wjifen.model;

import java.util.Date;

import javax.persistence.Entity;

/**
 * 商店礼品兑换记录
 * 
 * @author WEI
 *
 */
@Entity
public class ShopProductExchange {

	/**
	 * 主键
	 */
	private Long id;
	
	/**
	 * 兑换时间
	 */
	private Date time = new Date();
	
	/**
	 * 商店礼品id（外键）
	 */
	private Long productId = 0L;
	
	/**
	 * 用户id（外键）
	 */
	private Long userId = 0L;
	
	/**
	 * 兑换数量
	 */
	private Integer count = 0;
	
	/**
	 * 兑换状态
	 */
	private Integer status = 0;

	/**
	 * 构造方法
	 * 动态创建实例，用于数据库读写时，反射获取对象
	 * 
	 * @param id
	 * @param time
	 * @param giftId
	 * @param userId
	 * @param count
	 * @param status
	 */
	public ShopProductExchange(Long id, Date time, Long productId, Long userId,
			Integer count, Integer status) {
		super();
		this.id = id;
		this.time = time;
		this.productId = productId;
		this.userId = userId;
		this.count = count;
		this.status = status;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public Long getProductId() {
		return productId;
	}

	public void setProductId(Long productId) {
		this.productId = productId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	/**
	 * 用于测试
	 */
	@Override
	public String toString() {
		return "ShopProductExchange [id=" + id + ", time=" + time + ", productId="
				+ productId + ", userId=" + userId + ", count=" + count
				+ ", status=" + status + "]";
	}
	
}
